package excel

type Row struct {
	//行序号
	Index int

	//包含的哪些值
	Cells []*Cell
}

func (this *Row) WithIndex(index int) *Row {
	this.Index = index
	return this
}

func (this *Row) GetColSize() (size int) {
	return len(this.Cells)
}

func (this *Row) AppendCell(cells ...*Cell) *Row {
	curColSize := this.GetColSize()
	for k, v := range cells {
		v.RowIndex = this.Index
		v.ColIndex = curColSize + k + 1
	}
	this.Cells = append(this.Cells, cells...)
	return this
}

func NewRow() *Row {
	return &Row{}
}
